import 'package:example/components/pool.dart';
import 'package:fish_redux/fish_redux.dart';


class PageState implements Cloneable<PageState> {
   List<Map<String, dynamic>>? data;

  @override
  PageState clone() {
    return PageState()
      ..data = data;
  }
}

PageState initState(Map<String, dynamic>? args) {
  //just demo, do nothing here...
  return PageState();
}

class PageConnector extends ConnOp<PageState, Map<String, dynamic>>
    with ReselectMixin<PageState, Map<String, dynamic>> {

  String dataKey;
  PageConnector(this.dataKey);

  @override
  void set(PageState state, Map<String, dynamic> subState) {
    throw Exception('Unexcepted to set PageState from ReportState');
  }

  @override
  Map<String, dynamic> computed(PageState state) {
    final Map<String, dynamic>? result = dataMap[dataKey];
    if (result != null) {
      return result;
    } else {
      return <String, dynamic>{};
    }
  }
}
